<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="shortcut icon" href="http://training-static.linesno.com/switch_run/favicon.ico" />
<title>云主机管理后台</title>
<link href="http://training-static.linesno.com/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href="http://training-static.linesno.com/sb-admin/css/sb-admin.css" rel="stylesheet">
<link href="http://training-static.linesno.com/vendor/fontawesome-free/css/all.min.css" rel="stylesheet" type="text/css">
<link href="http://training-static.linesno.com/vendor/datatables/dataTables.bootstrap4.css" rel="stylesheet">
<link href="http://training-static.linesno.com/jq-datapicker/css/foundation-datepicker.css" rel="stylesheet" type="text/css">
	
</head>

<body>
	<div class="container-fluid">
		<br />
		<div class="row">
			<!-- 
				<div class="col-4">1 of 3</div>
				 -->
			<div class="col-12">
				<form id="modifyForm">
				
					<input type="hidden" name="id" th:value="${bean.id}" />
						
					<div class="form-group row">
						<label class="col-sm-2 col-form-label" for="exampleInputPassword1">数据库登陆名</label>
						<div class="col-sm-10">
							<input type="text" class="form-control" th:value="${bean.dbaLoginName}" name="dbaLoginName" placeholder="数据库登陆名">
						</div>
					</div>
					<div class="form-group row">
						<label class="col-sm-2 col-form-label" for="exampleInputPassword1">数据库使用描述</label>
						<div class="col-sm-10">
							<input type="text" class="form-control" th:value="${bean.spaceDesc}" name=spaceDesc placeholder="数据库使用描述">
						</div>
					</div>
					<div class="form-group row">
						<label class="col-sm-2 col-form-label" for="exampleInputPassword1">数据库空间</label>
						<div class="col-sm-10">
							<input type="text" class="form-control"  th:value="${bean.dataSpaceName}"  name=dataSpaceName placeholder="数据库空间">
						</div>
					</div>
					<div class="form-group row">
						<label class="col-sm-2 col-form-label" for="exampleInputPassword1">数据库空间大小</label>
						<div class="col-sm-10">
							<input type="text" class="form-control"  th:value="${bean.dataSpaceSize}"  name=dataSpaceSize placeholder="数据库空间大小">
						</div>
					</div>
					<div class="form-group row">
						<label class="col-sm-2 col-form-label" for="exampleInputPassword1">索引空间</label>
						<div class="col-sm-10">
							<input type="text" class="form-control" th:value="${bean.indexSpaceName}"  name="indexSpaceName" placeholder="索引空间">
						</div>
					</div>
					<div class="form-group row">
						<label class="col-sm-2 col-form-label" for="exampleInputPassword1">索引空间大小</label>
						<div class="col-sm-10">
							<input type="text" class="form-control" th:value="${bean.indexSpaceSize}"  name="indexSpaceSize" placeholder="索引空间大小">
						</div>
					</div>
					<div class="form-group row">
						<label class="col-sm-2 col-form-label" for="exampleInputPassword1">所属主机</label>
						<div class="col-sm-10">
							<input type="text" class="form-control"  th:value="${bean.hostIp}"  name="hostIp" placeholder="数据库空间">
						</div>
					</div>

					<div class="form-group row">
						<label class="col-sm-2 col-form-label" for="exampleInputPassword1">管理员</label>
						<div class="col-sm-10">
							<input type="text" class="form-control" th:value="${bean.managerMan}" name="managerMan" placeholder="管理员">
						</div>
					</div>
					
					<div class="form-group row">
						<label class="col-sm-2 col-form-label" for="exampleInputPassword1">开始时间</label>
						<div class="col-sm-10">
							<input type="text" class="form-control" th:value="${#dates.format(bean.sendTime, 'MM/dd/yyyy')}" name="sendTime" placeholder="开始时间">
						</div>
					</div>

					<div class="form-group row">
						<label class="col-sm-2 col-form-label" for="exampleInputPassword1">结束时间</label>
						<div class="col-sm-10">
							<input type="text" class="form-control" th:value="${#dates.format(bean.endTime, 'MM/dd/yyyy')}" name="endTime" placeholder="结束时间">
						</div>
					</div>

					<br />
					<button type="button" onclick="save()"
						class="btn btn-primary btn-lg btn-block">更新</button>
				</form>
			</div>
		</div>
	</div>

	<script src="http://training-static.linesno.com/vendor/jquery/jquery.min.js"></script>
	<script src="http://training-static.linesno.com/vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
	<script src="http://training-static.linesno.com/layer/layer.js"></script>
	<script src="http://training-static.linesno.com/js/jquery.form/jquery.form.js"></script>
		
		
	<!-- jquery datapicker -->
	<script src="http://training-static.linesno.com/jq-datapicker/js/foundation-datepicker.js"></script>
	<script src="http://training-static.linesno.com/jq-datapicker/js/locales/foundation-datepicker.zh-CN.js"></script>
		

	<script type="text/javascript">
	
			$(function(){
				$('input[name=sendTime]').fdatepicker({format: 'mm/dd/yyyy'});	
				$('input[name=endTime]').fdatepicker({format: 'mm/dd/yyyy'});	
			}) ; 

			var options = {
			    url: "/manager/database_modify_save", 
			    type: "post",   
			    success: successfun,
			    dataType: "json", 
			    timeout: 3000     
			};
			
			function save(){
				$('#modifyForm').ajaxSubmit(options) ; 
			}
			
			function successfun(response, status) {
			    layer.msg(response.message);
			}

			function preview(file) {
				var prevDiv = document.getElementById('preview');
				if (file.files && file.files[0]) {
					var reader = new FileReader();
					reader.onload = function(evt) {
						prevDiv.innerHTML = '<img style="width: 80px; height: 80px; margin-top: 10px; border-radius: 5px;" src="' + evt.target.result + '" />';
					}
					reader.readAsDataURL(file.files[0]);
				} else {
					prevDiv.innerHTML = '<div class="img" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src=\'' + file.value + '\'"></div>';
				}
			}
		</script>

</body>
</html>
